import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/blade-casemanagement/caseManagement/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/blade-casemanagement/caseManagement/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const getTrialDetail = (id) => {
  return request({
    url: '/blade-casemanagement/caseManagement/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/blade-casemanagement/caseManagement/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/blade-casemanagement/caseManagement/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/blade-casemanagement/caseManagement/submit',
    method: 'post',
    data: row
  })
}

export const listByCase = (current, size, params) => {
  return request({
    url: '/blade-trial/trial/listByCase',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const eleMedicalRecordList = (current, size, params) => {
  return request({
    url: '/blade-elemedicalrecord/eleMedicalRecord/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const eleMedicalRecordSubmit = (row) => {
  return request({
    url: '/blade-elemedicalrecord/eleMedicalRecord/submit',
    method: 'post',
    data: row
  })
}

export const eleMedicalRecordRemove = (ids) => {
  return request({
    url: '/blade-elemedicalrecord/eleMedicalRecord/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const eleMedicalRecordDetail = (id) => {
  return request({
    url: '/blade-elemedicalrecord/eleMedicalRecord/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const addFromCaseManagement = (row) => {
  return request({
    url: '/blade-clinicalcase/clinicalCase/addFromCaseManagement',
    method: 'post',
    params: row
  })
}
